package com.sumainfor.pc.gmio.controller.provider;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.gmio.service.impl.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 运营部搜索
 * @author zhoucong
 * @data 2019/9/19
 * @Param
 * @return
 */
@RestController
@RequestMapping("/key/provider/gmio/search")
public class SearchController {


    @Autowired
    private SearchService service;

    /**
     * 运营部查询
     *
     * @param keyWord
     * @param roleId
     * @return
     */
    @PostMapping("/searchForGmio")
    public JsonResult searchForGmio(String keyWord, Integer roleId) {

        /**
         * 10	| 服务管家
         * 9	| 服务秘书
         * 11	| 租后主管
         * 12	| 运营助理
         * 13   | 运营经理
         */


        JsonResult result;
        switch (roleId) {
            case 10:
                result = service.searchForFugj(keyWord); //服务管家
                break;
            case 9:
                result = service.searchForFums(keyWord); //服务秘书
                break;
            case 11:
                 result = service.searchForZhzg(keyWord); //租后主管
                break;
            case 12:
               result = service.searchForYyzlorYyjl(keyWord); //运营助理
                break;
           case 13:
               result = service.searchForYyzlorYyjl(keyWord); //运营经理
                break;
            default:
               result = JsonResult.error("没有这个类型的角色");
        }
       return result;
    }

}
